Compressor parts, particularly the motor, shaft, and bearings such as magnetic bearings require cooling while the compressor is in operation. The cooling may be provided, for example, by a flow of compressed gas discharged from the compressor. However, the flow of compressed gas may cause inefficiency due to drag and windage losses. The cooling demands of the compressor parts may vary with the speed of operation of the compressor and the pressure it produces at its discharge. Current systems use fixed-size holes to allow compressed gas to enter a casing of a motor of the compressor to cool compressor components.